package com.sino.tb.derate.entity;

import java.sql.*;
import java.util.*;
import xpubbean.Db.*;
import com.sino.tb.*;

public class VecPayer {
	private String key;
	private String unitMan;
	private String unitOutlay;
	private String flag;
	private String vecKey;
	private String vecType;
	private String payerName;
	private String code;
	private int freeNumber;
	private int reduceNumber;
	private int passFreeNumber;
	private int passReduceNumber;

	public VecPayer(String seq, Connection conn) {
		String sql = "SELECT t1.c_seq as c_payer_id, t1.c_code, t1.c_name, t1.c_type, t2.* " +
					 "FROM   t_vec_payer t1, " +
					 "	   t_derate_unit_std t2 " +
					 "WHERE  t1.c_seq = " + seq + " AND " +
					 "	   t1.c_seq = t2.c_payer_seq(+) ";

		ResultSetPlus rsp = new ResultSetPlus(sql, conn);
		if (rsp.next()) {
			this.setKey(rsp.getFieldStr("c_payer_id"));
			this.setVecKey(rsp.getFieldStr("c_payer_id"));
			this.setUnitMan(rsp.getFieldStr("c_unit_man"));
			this.setUnitOutlay(rsp.getFieldStr("c_unit_outlay"));
			this.setFreeNumber(rsp.getFieldStr("c_free_number").equals("0.0")?0:Integer.parseInt(rsp.getFieldStr("c_free_number")));
			this.setReduceNumber(rsp.getFieldStr("c_reduce_number").equals("0.0")?0:Integer.parseInt(rsp.getFieldStr("c_reduce_number")));
			this.setFlag(rsp.getFieldStr("c_sys_flag"));
			this.setVecType(rsp.getFieldStr("c_type"));
			this.setPayerName(rsp.getFieldStr("c_name"));
			this.setCode(rsp.getFieldStr("c_code"));

		}
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getUnitMan() {
		return unitMan;
	}

	public void setUnitMan(String unitMan) {
		this.unitMan = unitMan;
	}

	public String getUnitOutlay() {
		return unitOutlay;
	}

	public void setUnitOutlay(String unitOutlay) {
		this.unitOutlay = unitOutlay;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public String getVecKey() {
		return vecKey;
	}

	public void setVecKey(String vecKey) {
		this.vecKey = vecKey;
	}

	public String getVecType() {
		return vecType;
	}

	public void setVecType(String vecType) {
		this.vecType = vecType;
	}

	public String getPayerName() {
		return payerName;
	}

	public void setPayerName(String payerName) {
		this.payerName = payerName;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getFreeNumber() {
		return freeNumber;
	}

	public void setFreeNumber(int freeNumber) {
		this.freeNumber = freeNumber;
	}

	public int getReduceNumber() {
		return reduceNumber;
	}

	public void setReduceNumber(int reduceNumber) {
		this.reduceNumber = reduceNumber;
	}

	public int getPassFreeNumber() {
		return passFreeNumber;
	}

	public void setPassFreeNumber(int passFreeNumber) {
		this.passFreeNumber = passFreeNumber;
	}

	public int getPassReduceNumber() {
		return passReduceNumber;
	}

	public void setPassReduceNumber(int passReduceNumber) {
		this.passReduceNumber = passReduceNumber;
	}
}
